//
//  SINAUserModel.m
//  sinashebao
//
//  Created by  androidlongs on 2017/12/28.
//  Copyright © 2017年  androidlongs. All rights reserved.
//

#import "SINAUserModel.h"

@implementation SINAUserModel

-(instancetype)initWithDict:(NSDictionary *)result{
    if (self=[super init]) {
//        NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
        // 用户的 id
        _userId= [NSString stringWithFormat:@"%@",result[@"id"]];
        //用户的uid
        _userUid=[NSString stringWithFormat:@"%@",result[@"uuid"]];
        _sign=[NSString stringWithFormat:@"%@",result[@"sign"]];
        if (_sign==nil||[_sign isEqualToString:@""]||[_sign isEqualToString:@"(null)"]) {
            _sign=@"世界这么美 不妨写个签名吧";
        }
        //用户的token
        _userToken = [NSString stringWithFormat:@"%@",result[@"userToken"]];
        //用户的userName
        _userName=[NSString stringWithFormat:@"%@",result[@"name"]];
        //用户的头像 userTitleImage
        _userTitleImageUrl =[NSString stringWithFormat:@"%@",result[@"headimg"]];
        //用户的电话
        _userPhone = [NSString stringWithFormat:@"%@",result[@"phone"]];
        _number = [NSString stringWithFormat:@"%@",result[@"number"]];
        _department = [NSString stringWithFormat:@"%@",result[@"department"]];
        _userSex = [NSString stringWithFormat:@"%@",result[@"sex"]];
        
        //用户的昵称
        _userNike= [NSString stringWithFormat:@"%@",result[@"nickname"]];
        _userRealName=[NSString stringWithFormat:@"%@",result[@"realname"]];
        //用户的身份  老师 学生
        _identitys= [NSString stringWithFormat:@"%@",result[@"identity"]];
        
        
        _classifyid= [NSString stringWithFormat:@"%@",result[@"classifyid"]];
        _collegeid= [NSString stringWithFormat:@"%@",result[@"collegeid"]];
        _collsystemid= [NSString stringWithFormat:@"%@",result[@"collsystemid"]];
        _majorid=[NSString stringWithFormat:@"%@", result[@"majorid"]];
        _universityid= [NSString stringWithFormat:@"%@",result[@"universityid"]];
        
        _qqopenid = [NSString stringWithFormat:@"%@",result[@"qqopenid"]];
        _qqnickname = [NSString stringWithFormat:@"%@",result[@"qqnickname"]];
        _weixinopenid = [NSString stringWithFormat:@"%@",result[@"weixinopenid"]];
        _weixinnickname = [NSString stringWithFormat:@"%@",result[@"weixinnickname"]];
    }
    return self;
}
+(instancetype)userWithDict:(NSDictionary *)dict{
    return [[self alloc] initWithDict:dict];
}

@end
